package com.wenjiang.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wenjiang.entity.MallMenu;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MallMenuMapper extends BaseMapper<MallMenu> {
    //获取全部路由
    List<MallMenu> getAllMenu();

    //查找父菜单的子菜单
    List<MallMenu> getChildren(int parentId);

    // 获取角色所用所用有的菜单id
    List<Integer> getRoleMenu(Integer roleId);

    //清空用户所拥有的菜单id
    public  void  deleteRoleMenu(Integer roleId);

    // 添加用户拥有的菜单id
    public  void  insertMenu(@Param("roleId") Integer roleId, @Param("menuIds") List<Integer> menuIds);
}
